import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router);
//import index from '../views/index';
//
//import decision from "../views/decision";
//
//import proposal from "../views/proposal";      //智能决策-建议订单与到货
//import forecast from "../views/forecast";

//库存总览
const InventoryOverview=resolve=>require(['../views/InventoryOverview'],resolve);

//智能分类页面
const IntelligentClassification = resolve =>require(['../views/IntelligentClassification'], resolve);
//智能反馈
const IntelligentFeedback = resolve =>require(['../views/IntelligentFeedback'], resolve);


//智能决策-建议订单与到货
//登陆
const login = resolve =>require(['../views/login'],resolve);
//重置密码
const rePassword=resolve=>require(['../views/rePassword'],resolve);
//主页
const index = resolve =>require(['../views/index'], resolve);
//404页面
const error404 = resolve =>require(['../views/error404'], resolve);
//500页面
const error500 = resolve =>require(['../views/error500'], resolve);
//
const decision = resolve =>require(['../views/decision'], resolve);

//智能决策-建议订单与到货
const proposal = resolve =>require(['../views/proposal'], resolve);

//智能决策-需求预测
const forecast = resolve =>require(['../views/forecast'], resolve);
//智能决策-决策依据
const basis = resolve =>require(['../views/basis'], resolve);

//智能分析-物料分类
const item = resolve =>require(['../views/IntelligentClassificationItem'], resolve);
//智能分析-供应商分类
const supplier = resolve =>require(['../views/IntelligentClassificationSupplier'], resolve);
//智能分析-关联分析
const relative = resolve =>require(['../views/IntelligentClassificationRelative'], resolve);
//注册页面
const register = resolve=>require(['../views/register'],resolve);
//管理员
const manager=resolve=>require(['../views/manager'],resolve);

const routes = [
  {
    path: '/login',
    name: 'login',
    component: login
  },
  {
    path:'/rePassword',
    name:'rePassword',
    component:rePassword
  },
  {
    path: '/register',
    name: 'register',
    component: register
  },
  {
    path: '/index',
   /* name: 'index',*/
    component: index,
    children: [
      {
        path:'/InventoryOverview',
        component:InventoryOverview,
        name:'InventoryOverview'
      },
      {
        path: '/decision',
       /* name: 'decision',*/
        component: decision,
        children: [
          {
            path: '/proposal',
            name: 'proposal',
            component: proposal
          },
          {
            path: '/forecast',
            name: 'forecast',
            component: forecast
          },
          {
            path: '/basis',
            name: 'basis',
            component: basis
          },
          {
            path: '/',
            redirect: {
              path: '/forecast' // 默认所有都跳转到拓展门店报告页
            }
          }
        ]
      },
      {
        path: '/IntelligentClassification',
        component: IntelligentClassification,
       /* name: 'IntelligentClassification',*/
        children: [
          {
            path: '/item',
            name: 'item',
            component: item
          },
          {
            path: '/supplier',
            name: 'supplier',
            component: supplier
          },
          {
            path: '/relative',
            name: 'relative',
            component: relative
          },
          {
            path: '/',
            redirect: {
              path: '/item' // 默认物料分类
            }
          }
        ]
      },
      {
        path: '/IntelligentFeedback',
        component: IntelligentFeedback,
        name: 'IntelligentFeedback'
      },
      {
        path:'/index/manager',
        name:'manager',
        component:manager
      },
      {
        path: '/',
        redirect: {
          path: '/decision' // 默认所有都跳转到拓展门店报告页
        }
      }
    ]
  },
  {
    path: '/error404',
    name: 'error404',
    component: error404
  },
  {
    path: '/error500',
    name: 'error500',
    component: error500
  },
  {
    path: '/',
    redirect: {
      path: '/login' // 默认所有都跳转到拓展门店报告页
    }
  }
]
const router = new Router({
  routes: routes
})




export default router




